Conversation
📝 WalkthroughWalkthroughAdds portable linux-x64 runtime NuGet packages (standard and slim), CI steps to pack them on Ubuntu 22.04, and documentation updates to recommend linux-x64 as the portable RID for Linux runtimes. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (1)
nuget/OpenCvSharp4.official.runtime.linux-x64.csproj (1)
25-25: Same backslash icon path as the slim variant
icon\opencvsharp.png— same concern as inlinux-x64.slim.csproj. Prefericon/opencvsharp.pngfor consistency.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@nuget/OpenCvSharp4.official.runtime.linux-x64.csproj` at line 25, Update the <None Include="icon\opencvsharp.png" Pack="true" PackagePath="" /> entry by replacing the backslash in the Include attribute with a forward slash (icon/opencvsharp.png) so the icon path matches the slim variant and uses consistent, cross-platform path separators.
🧹 Nitpick comments (2)
README.md (1)
57-70: Document the glibc/libc baseline implicit in thelinux-x64packageThe
linux-x64.sois built on Ubuntu 22.04, which links against glibc 2.35. This means the package will silently fail at runtime on systems with an older glibc (e.g., Alpine/musl, RHEL 7, Debian 10). A brief note in the installation section would save users from hard-to-diagnose runtime crashes.Example addition to the section:
> **Note:** The `linux-x64` native binary is compiled on Ubuntu 22.04 (glibc 2.35). > It will not work on musl-based distros (e.g., Alpine) or systems with glibc < 2.35.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@README.md` around lines 57 - 70, Add a short runtime compatibility note to the "Linux (Ubuntu and other distributions)" installation text mentioning that the OpenCvSharp4.official.runtime.linux-x64 native binary is compiled on Ubuntu 22.04 and links against glibc 2.35, so it will fail on musl-based distros (e.g., Alpine) or systems with glibc < 2.35; place the note near the package installation steps and reference the package name OpenCvSharp4.official.runtime.linux-x64 and the glibc version to warn users about potential silent runtime failures..github/workflows/ubuntu-slim.yml (1)
186-196: Missing artifact listing after pack (minor inconsistency withubuntu.yml)The new step in
ubuntu.ymlends withls ${GITHUB_WORKSPACE}/artifactsfor debugging, but this step omits it. No functional impact, but inconsistent.🔧 Suggested fix
cd ${GITHUB_WORKSPACE}/opencvsharp dotnet pack "nuget/OpenCvSharp4.official.runtime.linux-x64.slim.csproj" -o ${GITHUB_WORKSPACE}/artifacts -p:Version=$version + + ls ${GITHUB_WORKSPACE}/artifacts🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/ubuntu-slim.yml around lines 186 - 196, Add a trailing artifacts listing to match the other workflow step: after the dotnet pack command that builds the slim runtime package (the line invoking dotnet pack "nuget/OpenCvSharp4.official.runtime.linux-x64.slim.csproj" -o ${GITHUB_WORKSPACE}/artifacts -p:Version=$version), add a command to run ls ${GITHUB_WORKSPACE}/artifacts so the step prints the generated artifacts (keep the surrounding env variables BETA, yyyymmdd, and version unchanged).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@nuget/OpenCvSharp4.official.runtime.linux-x64.slim.csproj`:
- Line 24: Update the MSBuild item Include path to use a forward slash so it
matches the actual filesystem and the surrounding entries: change the None
Include attribute value from using a backslash (icon\opencvsharp.png) to a
forward-slash path (icon/opencvsharp.png) in the <None Include="..."> element so
the icon path is consistent and cross-platform.
In `@README.md`:
- Around line 170-171: Update the README.md table entries for
OpenCvSharp4.official.runtime.linux-x64 and
OpenCvSharp4.official.runtime.linux-x64.slim so the links won't 404 before first
publish: either replace the nuget.org anchors with placeholder text (e.g.,
"nuget link (pending publish)"), remove the hyperlink and keep package names as
plain text, or add a parenthetical note like "(NuGet package will 404 until
first publish)" next to the package names; ensure the change is applied to the
two symbols OpenCvSharp4.official.runtime.linux-x64 and
OpenCvSharp4.official.runtime.linux-x64.slim in README.md.
---
Duplicate comments:
In `@nuget/OpenCvSharp4.official.runtime.linux-x64.csproj`:
- Line 25: Update the <None Include="icon\opencvsharp.png" Pack="true"
PackagePath="" /> entry by replacing the backslash in the Include attribute with
a forward slash (icon/opencvsharp.png) so the icon path matches the slim variant
and uses consistent, cross-platform path separators.
---
Nitpick comments:
In @.github/workflows/ubuntu-slim.yml:
- Around line 186-196: Add a trailing artifacts listing to match the other
workflow step: after the dotnet pack command that builds the slim runtime
package (the line invoking dotnet pack
"nuget/OpenCvSharp4.official.runtime.linux-x64.slim.csproj" -o
${GITHUB_WORKSPACE}/artifacts -p:Version=$version), add a command to run ls
${GITHUB_WORKSPACE}/artifacts so the step prints the generated artifacts (keep
the surrounding env variables BETA, yyyymmdd, and version unchanged).
In `@README.md`:
- Around line 57-70: Add a short runtime compatibility note to the "Linux
(Ubuntu and other distributions)" installation text mentioning that the
OpenCvSharp4.official.runtime.linux-x64 native binary is compiled on Ubuntu
22.04 and links against glibc 2.35, so it will fail on musl-based distros (e.g.,
Alpine) or systems with glibc < 2.35; place the note near the package
installation steps and reference the package name
OpenCvSharp4.official.runtime.linux-x64 and the glibc version to warn users
about potential silent runtime failures.
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
.github/workflows/ubuntu-slim.yml.github/workflows/ubuntu.ymlREADME.mddocs/embedded-builds.mdnuget/OpenCvSharp4.official.runtime.linux-x64.csprojnuget/OpenCvSharp4.official.runtime.linux-x64.slim.csproj
| |**[OpenCvSharp4.official.runtime.linux-x64](https://www.nuget.org/packages/OpenCvSharp4.official.runtime.linux-x64/)**| Native bindings for Linux x64 (portable RID, recommended) | | ||
| |**[OpenCvSharp4.official.runtime.linux-x64.slim](https://www.nuget.org/packages/OpenCvSharp4.official.runtime.linux-x64.slim/)**| Slim native bindings for Linux x64 (portable RID), with `core,imgproc,imgcodecs,calib3d,features2d,flann,objdetect,photo` enabled | |
There was a problem hiding this comment.
NuGet links will 404 until the first publish
The package links in the table point to packages that won't exist on nuget.org until this PR is merged and a publish workflow runs. Consider using placeholder text or a note until the packages are live, or ensure the publish workflow is part of this PR / triggered immediately after merge.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@README.md` around lines 170 - 171, Update the README.md table entries for
OpenCvSharp4.official.runtime.linux-x64 and
OpenCvSharp4.official.runtime.linux-x64.slim so the links won't 404 before first
publish: either replace the nuget.org anchors with placeholder text (e.g.,
"nuget link (pending publish)"), remove the hyperlink and keep package names as
plain text, or add a parenthetical note like "(NuGet package will 404 until
first publish)" next to the package names; ensure the change is applied to the
two symbols OpenCvSharp4.official.runtime.linux-x64 and
OpenCvSharp4.official.runtime.linux-x64.slim in README.md.
There was a problem hiding this comment.
🧹 Nitpick comments (2)
nuget/OpenCvSharp4.official.runtime.linux-x64.slim.csproj (2)
3-3: Trailing semicolon inTargetFrameworks.The value
netstandard2.0;netstandard2.1;net8.0;has a dangling semicolon after the last framework. MSBuild tolerates it, but it is non-idiomatic and inconsistent with SDK-style project conventions.♻️ Proposed fix
- <TargetFrameworks>netstandard2.0;netstandard2.1;net8.0;</TargetFrameworks> + <TargetFrameworks>netstandard2.0;netstandard2.1;net8.0</TargetFrameworks>🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@nuget/OpenCvSharp4.official.runtime.linux-x64.slim.csproj` at line 3, Remove the dangling semicolon from the TargetFrameworks element value so it lists frameworks as "netstandard2.0;netstandard2.1;net8.0" (no trailing semicolon). Edit the TargetFrameworks entry in the project file (the TargetFrameworks XML element) to trim the trailing ';' to match SDK-style project conventions and avoid the non-idiomatic dangling separator.
23-23: Add trailing slash toPackagePathto explicitly denote a directory path.According to official Microsoft NuGet documentation,
PackagePathmust end with a folder separator (/or\) to be treated as a directory. Without it, NuGet interpretsPackagePath="runtimes/linux-x64/native"as a complete file path rather than a directory designation, which could placelibOpenCvSharpExtern.soincorrectly.This same pattern exists in the sibling non-slim project (
OpenCvSharp4.official.runtime.linux-x64.csproj), so consider updating both files consistently:♻️ Proposed fix
- <None Include="libOpenCvSharpExtern.so" Pack="true" PackagePath="runtimes/linux-x64/native" /> + <None Include="libOpenCvSharpExtern.so" Pack="true" PackagePath="runtimes/linux-x64/native/" />🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@nuget/OpenCvSharp4.official.runtime.linux-x64.slim.csproj` at line 23, The PackagePath attribute for the None item referencing libOpenCvSharpExtern.so is missing a trailing folder separator so NuGet may treat it as a file path; update the None element's PackagePath value from "runtimes/linux-x64/native" to "runtimes/linux-x64/native/" (add the trailing slash) to explicitly mark a directory, and apply the same change to the sibling OpenCvSharp4.official.runtime.linux-x64.csproj to keep both projects consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@nuget/OpenCvSharp4.official.runtime.linux-x64.slim.csproj`:
- Line 3: Remove the dangling semicolon from the TargetFrameworks element value
so it lists frameworks as "netstandard2.0;netstandard2.1;net8.0" (no trailing
semicolon). Edit the TargetFrameworks entry in the project file (the
TargetFrameworks XML element) to trim the trailing ';' to match SDK-style
project conventions and avoid the non-idiomatic dangling separator.
- Line 23: The PackagePath attribute for the None item referencing
libOpenCvSharpExtern.so is missing a trailing folder separator so NuGet may
treat it as a file path; update the None element's PackagePath value from
"runtimes/linux-x64/native" to "runtimes/linux-x64/native/" (add the trailing
slash) to explicitly mark a directory, and apply the same change to the sibling
OpenCvSharp4.official.runtime.linux-x64.csproj to keep both projects consistent.
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
nuget/OpenCvSharp4.official.runtime.linux-x64.csprojnuget/OpenCvSharp4.official.runtime.linux-x64.slim.csproj
🚧 Files skipped from review as they are similar to previous changes (1)
- nuget/OpenCvSharp4.official.runtime.linux-x64.csproj
Fix #1820
Summary by CodeRabbit
New Features
Documentation
Chores